#pragma once

#include "NBTFile.h"
#include "NBTTagWrapper.h"

using namespace System;

public ref class NBTFileWrapper
{
	NBTFile *_file;
	NBTTagWrapper ^_root;

public:
	NBTFileWrapper(System::String ^str, bool compressed)
	{
		std::string asString;
		asString.reserve(str->Length);

		for (int i = 0; i < str->Length; ++i)
			asString += str[i];

		_file = new NBTFile();
		_file->Load(asString, compressed);

		_root = gcnew NBTTagWrapper(_file->Root);
	}

	~NBTFileWrapper()
	{
		delete _file;
	}

	property NBTTagWrapper ^Root
	{
		NBTTagWrapper ^get()
		{
			return _root;
		}
	}
};